<?php
/*
Template Name: PostsList
*/

$cat = $wp_query->query_vars['pagename'];

if ($cat == 'recentworks' )
	$cat = 'portfolio';

$args = array('numberposts' => 10, 'category' => get_catID_by_slug($cat));
$posts = get_posts($args);

?>
<?php get_header(); ?>
<div id="content" class="widecolumn" style='background:none;'>
<?
if ($_SESSION['is_subnav'])
	echo "<div style='height:0px;clear:both;'></div>";

if ( count($posts) ) :
	foreach ( $posts as $post )  { 
		if ( ! post_is_cat($post->ID, get_catID_by_slug('NOT_ON_HOME')) ) {
			setup_postdata($post);
			?>
			<div class="post" id="post-<?php the_ID(); ?>">
				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
				<div class='post-website'><a href='http://<?=get_post_meta($post->ID, 'website', true)?>' target='_blank'><?=get_post_meta($post->ID, 'website', true)?></a></div>
				<div class="entry">
					<?php the_content('Read the rest of this entry &raquo;'); ?>
				</div>
				<p class="postmetadata">| Posté le <?php the_time('j F Y') ?> <?php comments_popup_link('| Aucun Commentaires &#187;', '| 1 Commentaire &#187;', '| % Commentaires &#187;'); ?></p>
			</div>
			<? 
		}
	} 
else : 
	?>
	<h2 class="center">Not Found</h2>
	<p class="center">Sorry, but you are looking for something that isn't here.</p>
	<?php include (TEMPLATEPATH . "/searchform.php"); ?>
	<? 
endif; 
?>
<?php get_footer(); ?>